import socket


def connect():
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    host = socket.gethostname()
    port = 9999
    s.connect((host, port))

    s.send("我是客户端01".encode('utf8'))
    msg = s.recv(1024)
    s.close()
    print(msg.decode('utf8'))


if __name__ == '__main__':
    connect()
